home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / Alpha Developers FAQ < prev    next >
Encoding:
Text File  |  2000-10-27  |  4.1 KB  |  93 lines

  1.  
  2.             Developers FAQ
  3.  
  4.                           created: 03/01/2000 {14:18:04 PM}
  5.                       last update: 10/27/2000 {14:33:15 PM}
  6.  
  7. Author:    Vince Darley
  8. E-mail:    <vince@santafe.edu>
  9.   mail:    317 Paseo de Peralta, Santa Fe, NM 87501, USA
  10.    www:    <http://www.santafe.edu/~vince/>
  11.  
  12.  
  13. For those developing modes, menus, and other features for Alpha and
  14. Alphatk, or simply hacking away at existing code, this file contains
  15. the answers to some frequently asked questions.  Feel free to suggest
  16. new questions and answers (on the Alpha-D mailing list).
  17.  
  18. If you are sending files to any of the core developers of Alpha,
  19. please ensure they are encoded in some way (whether binhex'd, stuffed,
  20. macbinarized, or whatever).  Many of Alpha's .tcl and help files
  21. contain ascii characters > 128, which are usually garbled when a file 
  22. is sent as a plain attachment.
  23.  
  24. Ordinary Alpha(tk) 'users' will probably not find much of use here...
  25.  
  26. (Q1) I've added/changed some .tcl files but when I run Alpha and try
  27. to use the new features, I get an error 'invalid command name
  28. <myproc>'.  I'm sure myproc exists!
  29.  
  30. (A1) Tcl uses index files to work out how to locate previously unknown
  31. procedures.  If 'myproc' is new, it presumably isn't in those index
  32. files, and Tcl can't find it (except by chance, by loading a different
  33. proc in the same file).  So the solution is to rebuild your tcl indices
  34. -- the command is in the Alphadev menu.  Alternatively, in the Tcl
  35. shell (cmd-Y) you can 'cd' to the correct directory and type:
  36. 'auto_mkindex .'  to rebuild just the index in that directory.
  37.  
  38. (Q2) I've added/changed some .tcl files but when I run Alpha my entire
  39. package isn't even recognised.  Why not?
  40.  
  41. (A2) Alpha caches package information to avoid having to scan hundreds
  42. of files on startup.  You need to rebuild your package indices (the
  43. bottom of the Config->Packages menu).  Recent versions of AlphaTcl
  44. check whether the number of files/folders have changed and does a
  45. rebuild for you, which should avoid this problem.  Also see (A3)
  46.  
  47. (Q3) I made some minor changes to my alpha::feature/mode/menu command,
  48. and Alpha hasn't noticed the change.
  49.  
  50. (A3) Alpha caches package information to avoid having to scan hundreds
  51. of files on startup.  You need to rebuild your package indices (the
  52. bottom of the Config->Packages menu).  Also see (A2)
  53.  
  54. (Q4) Why should I use minPos/maxPos/pos::math/pos::compare/pos::diff?
  55. What's wrong with just using 'expr'?
  56.  
  57. (A4) Alpha's current windowing model simply uses numbers to represent 
  58. positions relative to the start of the window.  However Alphatk uses a
  59. more complex positioning scheme.  In the future we may change the
  60. windowing model of Alpha.  So, if you only care about having your code
  61. run on Alpha now, then 'expr' is fine.  For your code to run on
  62. Alphatk now, and to avoid incompatibility if Alpha changes in the
  63. future, you should use the pos:: functions.
  64.  
  65. (Q5) Does Alpha always use '\r' for line-endings?  What about
  66. Unix/PC files?
  67.  
  68. (A5) You're best off simply assuming that a line-ending may be either 
  69. '\r' or '\n'.  (Or sometimes a combination of the two).  In
  70. particular, Alphatk uses '\n', and files may use any of \r, \n, or \r\n
  71.  
  72. (Q6) What's the difference between 'rebuild package indices' and
  73. 'rebuild Tcl indices'?
  74.  
  75. (A6) The former rebuild's Alpha's database of package details -- all
  76. the information in those alpha::feature/mode/menu/extension commands.
  77. The latter rebuilds Tcl's database of which procedures are in which
  78. files.  Alpha's database is stored in your ${PREFS}:Cache:index 
  79. directory.  Tcl's database is stored in the tclIndex (or tclIndexx) 
  80. files in each directory in the 'Alpha:Tcl' hierarchy.
  81.  
  82. (Q7) What's the difference between: 'alpha::package require Alpha 7.2'
  83. and 'alpha::package require AlphaTcl 7.2'?
  84.  
  85. (A7) AlphaTcl is the library of Tcl code which comes with Alpha and
  86. Alphatk...  Most existing packages should only really test the version
  87. of AlphaTcl.  When Alpha 8.0 is released, new commands may appear, or
  88. old commands may have their behaviour slightly changed, in that case
  89. you may wish to test the version of Alpha.  Note that Alpha 8 and
  90. Alphatk 8 both use AlphaTcl versions 7.x at present.  So, you should
  91. use 'alpha::package require AlphaTcl ...'.
  92.  
  93.